<template>
  <!-- 搜索组件 -->
  <div id="search">
    <div class="search-container">
      <div class="search-title">查询</div>
      <el-form
        :inline="true"
        :model="formInline"
        class="demo-form-inline search"
      >
        <div class="block">
          <span class="demonstration">日期范围</span>
          <el-date-picker
            v-model="value1"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          >
          </el-date-picker>
        </div>

        <el-button>每日</el-button>
        <el-button>每周</el-button>
        <el-button>每月</el-button>

        <el-form-item class="search-item">
          <el-button type="success" icon="el-icon-search" @click="onSearch"
            >查询</el-button
          >
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      formInline: {
        search: '', //要搜索的内容
        user: '',
        region: ''
      },
      value1: ''
    }
  },
  methods: {
    //点击搜索的函数
    onSearch() {
      console.log('submit!')
    }
  }
}
</script>

<style lang="less" scoped>
.search-container {
  background-color: #fff;
  //   height: 8rem;
  border: 0.1rem solid #dbe0e9;
  .search-title {
    height: 4rem;
    background-color: #f2f2f2;
    box-sizing: border-box;
    border-bottom: 0.1rem solid #dbe0e9;
    line-height: 4rem;
    font-size: 1.4rem;
    padding-left: 3rem;
    font-weight: 500;
    color: #666666;
  }
  .search {
    display: flex;
    // flex-wrap: wrap;
    align-items: center;
    margin: 1rem;
    padding: 1.5rem;
    box-sizing: border-box;
    background-color: #f5f9fc;
    .el-form-item {
      margin-bottom: 0;
    }
    .dishes-name {
      margin-left: 1.5rem;
    }
    .block {
      margin-right: 2rem;
      .demonstration {
        font-size: 1.4rem;
        color: #606266;
        margin: 1.5rem;
      }
    }
  }
  .search-item {
    margin-left: 1.5rem;
  }
}
</style>
